package com.indusfo.spc.client.controller;

import com.indusfo.spc.client.service.ClientMatVerService;
import com.indusfo.spc.vo.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenm
 * @create 2020-01-09 9:27
 */
@RestController
@RequestMapping("/client/matVer")
public class ClientMatVerController {

    @Autowired
    private ClientMatVerService clientMatVerService;


    @PostMapping("/queryMatVer/{matId}")
    public JSONObject queryMat(@PathVariable("matId") Integer matId){
        try{
            return JSONObject.build(JSONObject.SUCCESS,"查询成功",clientMatVerService.queryByMatId(matId));
        }catch (Exception e){
            e.printStackTrace();
            return JSONObject.build(JSONObject.ERROR,"系统异常");
        }
    }

}
